package edu.shiep.sunyu.model;

import com.mongodb.BasicDBObject;

public class User implements BaseDBObj {
	
	public static final String Field_Id = "id";
	public static final String Field_Password = "password";
	public static final String Field_Type = "type";
	
	public User() {
		
	}
	
	public void deserialize(BasicDBObject obj) {
		_id = obj.getString(Field_Id);
		_password = obj.getString(Field_Password);
		_type = obj.getString(Field_Type);
	}
	
	public BasicDBObject serialize() {
		return new BasicDBObject(Field_Id, this._id).
				append(Field_Password, this._password).
				append(Field_Type, this._type);
	}
	
	public void setId(String _id) {
		this._id = _id;
	}
	
	public String getId() {
		return this._id;
	}
	
	public void setPassword(String _password) {
		this._password = _password;
	}
	
	public String getPassword() {
		return this._password;
	}
	
	public void setType(String _type) {
		this._type = _type;
	}
	
	public String getType() {
		return this._type;
	}
	
	private String _id = "";
	private String _password = "";
	private String _type = "";
	
}
